/*  

Cafechess Library: Cover basic chess programming needs, like GUI, Engine integration, 
FEN and PGN parsing.

                 \\|//
                 (o o)
--------------ooO-(_)-Ooo----------------------------------
Copyright (C) 2009  By Gregory A. Prentice Snoqualmie, WA
                    www.cafechess.org
                    cafechess@comcast.net
                      Oooo
--------------oooO----(  )---------------------------------
              (  )    (_/
               \_)

Microsoft Public License (Ms-PL)
               
Revisions:

Author        Date    Description:

*/
using System;
using System.Drawing;

namespace Cafechess.Imaging
{
	/// <summary>
	/// Defines the interface that an object must implement if it wishes
	/// to be managed by our cafechess.imaging.Layer object.
	/// </summary>
	public interface IDrawable : IDisposable
	{
    /// <summary>
    /// Name of this drawable object.
    /// </summary>
    string Name{ get; }
    /// <summary>
    /// The bounding rectangle for this drawable object.
    /// </summary>
    Rectangle Square{ get; set; }
    /// <summary>
    /// Is this object active?
    /// </summary>
    bool IsEnabled{ get; set; }
    /// <summary>
    /// Tell this guy to redraw itself at the next opportunity.
    /// </summary>
    bool IsRedraw{get; set; }
    /// <summary>
    /// Keeps an item from being remove, editted or anything.
    /// </summary>
    bool IsLocked{get; set; }
    /// <summary>
    /// Signal that this object is in the middle of a drag and drop opperation.
    /// </summary>
    bool IsDragging{get;set;}
    /// <summary>
    /// Clear any public values.
    /// </summary>
    void Clear();
    /// <summary>
    /// Determine if the point can select this object.
    /// </summary>
    /// <param name="point"></param>
    /// <returns></returns>
    bool HitTest(Point point);
    /// <summary>
    /// Paints this object to the supplied graphics object.  It is the reponsibility
    /// of this routine to check it's own IsRedraw flag before rendering itself.
    /// This allows the developer the ability to basically ignore this flag and
    /// always render this object.
    /// </summary>
    /// <param name="graphics"></param>
    void Render(System.Drawing.Graphics graphics);
    /// <summary>
    /// Retrieves any owner of this IDrawable object, Typically the owning
    /// Layer object.
    /// </summary>
    IDrawable Parent{get; set;}
	}
}
